/*
 * @Author: 霍格沃兹测试开发学社
 * @Desc: '更多测试开发技术探讨，请访问：https://ceshiren.com/t/topic/15860'
 */

package com.ceshiren.aitestmini.controller;

import com.ceshiren.aitestmini.dto.JenkinsDTO;
import com.ceshiren.aitestmini.service.JenkinsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class JenkinsController {
    @Autowired
    JenkinsService jenkinsService;

    @PostMapping(value = "createJob",produces = "application/json")
    void createJob(@RequestBody JenkinsDTO jenkinsDTO){
        jenkinsService.create(jenkinsDTO);
    }

    @PostMapping(value = "/buildJob/{jobName}",produces = "application/json")
    void buildJob(@RequestBody JenkinsDTO  jenkinsDTO){
        jenkinsService.build(jenkinsDTO);
    }
}
